const thunk = ({dispatch}) => next => action => {
  console.log('action')
  if (typeof action === 'function') {
    return action(dispatch)
  }
  next(action)
}